package com.frcdi.qms.masterdata.service.impl;

import com.frcdi.qms.masterdata.domain.ChangHistory;
import com.frcdi.qms.masterdata.mapper.ChangHistoryMapper;
import com.frcdi.qms.masterdata.service.IChangHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 变更历史Service业务层处理
 *
 * @author cell
 * @date 2024-01-16
 */
@Service
public class ChangHistoryServiceImpl implements IChangHistoryService
{
    @Autowired
    private ChangHistoryMapper changHistoryMapper;

    /**
     * 查询变更历史
     *
     * @param historyId 变更历史主键
     * @return 变更历史
     */
    @Override
    public ChangHistory selectChangHistoryByHistoryId(Long historyId)
    {
        return changHistoryMapper.selectChangHistoryByHistoryId(historyId);
    }

    /**
     * 查询变更历史列表
     *
     * @param changHistory 变更历史
     * @return 变更历史
     */
    @Override
    public List<ChangHistory> selectChangHistoryList(ChangHistory changHistory)
    {
        return changHistoryMapper.selectChangHistoryList(changHistory);
    }

    /**
     * 新增变更历史
     *
     * @param changHistory 变更历史
     * @return 结果
     */
    @Override
    public int insertChangHistory(ChangHistory changHistory)
    {
        return changHistoryMapper.insertChangHistory(changHistory);
    }

    /**
     * 修改变更历史
     *
     * @param changHistory 变更历史
     * @return 结果
     */
    @Override
    public int updateChangHistory(ChangHistory changHistory)
    {
        return changHistoryMapper.updateChangHistory(changHistory);
    }

    /**
     * 批量删除变更历史
     *
     * @param historyIds 需要删除的变更历史主键
     * @return 结果
     */
    @Override
    public int deleteChangHistoryByHistoryIds(Long[] historyIds)
    {
        return changHistoryMapper.deleteChangHistoryByHistoryIds(historyIds);
    }

    /**
     * 删除变更历史信息
     *
     * @param historyId 变更历史主键
     * @return 结果
     */
    @Override
    public int deleteChangHistoryByHistoryId(Long historyId)
    {
        return changHistoryMapper.deleteChangHistoryByHistoryId(historyId);
    }
}
